import request from './request'

// 用户管理API
export const userManagementAPI = {
  // 管理员添加教师
  addTeacher(data) {
    return request({
      url: '/user-management/teachers',
      method: 'post',
      data
    })
  },

  // 教师添加学生
  addStudent(data) {
    return request({
      url: '/user-management/students',
      method: 'post',
      data
    })
  },

  // 获取教师负责的学生列表
  getStudentsByTeacher(teacherId) {
    return request({
      url: `/user-management/teacher/${teacherId}/students`,
      method: 'get'
    })
  },

  // 分配学生给教师
  assignStudentToTeacher(studentId, teacherId) {
    return request({
      url: `/user-management/assign-student?studentId=${studentId}&teacherId=${teacherId}`,
      method: 'post'
    })
  },

  // 更新个人信息
  updateProfile(data) {
    return request({
      url: '/user-management/profile',
      method: 'put',
      data
    })
  }
}
